#include<bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
typedef long long ll;
ll modpow(ll x, ll n, ll m) {
    if(n==0) {return 1%m;}
    long long u = modpow(x, n/2, m);
    u = (u*u)%m;
    if(n%2==1) {u=(u*x)%m;}
    return u;
}
int main() {
  int k; cin>>k;
  long long ans = 6;
  for(int i=1; i<k; ++i) {
    ans = (ans * modpow(4, 1<<i, MOD))%MOD;
  }
  cout<<ans<<endl;
}